#ifndef AST_DECLARATIONS_STRUCT_DECLARATOR_H
#define AST_DECLARATIONS_STRUCT_DECLARATOR_H

#include "../ASTNode.h"
class Declarator;
class ConstantExpr;

/*
struct-declarator:
		declarator
		declarator(opt)    :    constant-expression
*/
class StructDeclarator : public ASTNode
{
protected:
	StructDeclarator(void)
		: ASTNode(ASTNode::struct_declarator){};
public:
	StructDeclarator(Declarator *pDecl)
		: ASTNode(ASTNode::struct_declarator)
		, m_pDecl(pDecl)
		, m_pConsExpr(NULL) {};
	StructDeclarator(ConstantExpr *pConsExpr, Declarator *pDecl = NULL)
		: ASTNode(ASTNode::struct_declarator)
		, m_pDecl(pDecl)
		, m_pConsExpr(pConsExpr) {};


	virtual ~StructDeclarator(void);

	virtual void					codeGen();
protected:
	Declarator *					m_pDecl;	//may be NULL
	ConstantExpr *					m_pConsExpr; // may be NULL
};


#endif


